<template>
  <div>
     <label for="">姓名：</label>
      <input type="text" v-model="loginFrom.username"><br/>
      <label for="">密码：</label>
      <input type="text" v-model="loginFrom.pwd"><br/>
      <input type="submit" value="提交" @click = "submitFrom">
  </div>
</template>

<script>
  export default {
      data(){
        return {
            loginFrom:{
              username:'admin',
              pwd:'123456'
            }
        }
      },
      methods:{
        submitFrom(){
             this.$store.dispatch("Logins",this.loginFrom).then(res=>{
               this.$router.push("/")
             })
        }
      }
  }
</script>

<style scoped>

</style>
